GENPATH=src/autogen
SRCPATH=src
SRC=$(SRCPATH)/syntax.y $(SRCPATH)/lexer.lex $(SRCPATH)/myheader.cpp
GEN=$(GENPATH)/y.tab.c $(GENPATH)/y.tab.h $(GENPATH)/lex.yy.c
bin/main:$(SRC) $(GEN)
	g++ $(wildcard $(GENPATH)/*.c) $(SRCPATH)/myheader.cpp -o bin/main -lfl -ly -I. -g -std=c++0x
$(GENPATH)/y.tab.c $(GENPATH)/y.tab.h:$(SRCPATH)/syntax.y
	cd $(GENPATH);yacc ../syntax.y -d --debug
$(GENPATH)/lex.yy.c:$(SRCPATH)/lexer.lex
	cd $(GENPATH);flex ../lexer.lex
clean:
	rm bin/* src/autogen/*
